VERSION 5.00
Begin VB.Form frmListaIdem 
   Caption         =   "Form1"
   ClientHeight    =   6570
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9645
   LinkTopic       =   "Form1"
   ScaleHeight     =   6570
   ScaleWidth      =   9645
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.ListBox List1 
      Height          =   2595
      Left            =   2760
      TabIndex        =   6
      Top             =   2160
      Width           =   2895
   End
   Begin VB.CommandButton Command1 
      Caption         =   ">>"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5880
      TabIndex        =   5
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command2 
      Caption         =   "<<"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5880
      TabIndex        =   4
      Top             =   3360
      Width           =   615
   End
   Begin VB.ListBox List2 
      Height          =   2595
      Left            =   6720
      TabIndex        =   3
      Top             =   2160
      Width           =   2895
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Aceptar"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   3840
      TabIndex        =   2
      Top             =   5280
      Width           =   1455
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Salir"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   7320
      TabIndex        =   0
      Top             =   5280
      Width           =   1455
   End
   Begin VB.Label SkinLabel1 
      Caption         =   "Iden:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2760
      TabIndex        =   1
      Top             =   1680
      Width           =   2775
   End
   Begin VB.Label SkinLabel2 
      Caption         =   "Seleccionados:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6720
      TabIndex        =   7
      Top             =   1680
      Width           =   2775
   End
End
Attribute VB_Name = "frmListaIdem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    List2.AddItem List1.list(List1.ListIndex)
End Sub
Function cual_precio(examen, precio)
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select *from precios where COD_exaMEN=" & examen & " AND NOMBREPRECIO='" & precio & "'")
    If t.EOF Then
        cual_precio = 0
    Else
        cual_precio = t("MONTO")
    End If
End Function
Function CualTipoPrecio(idem)
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select *from Relaciones where Iden='" & idem & "'")
    If t.EOF Then
       CualTipoPrecio = ""
    Else
        CualTipoPrecio = t("PRECIO")
    End If
End Function

Private Sub Command3_Click()
    'Un'Load 'FrmReporte
    Base.Execute "delete from listaprecios"
    Dim l As DAO.Recordset
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select *from examenes where recepcion=true")
    Set l = Base.OpenRecordset("LISTAPRECIOS")
    While Not t.EOF
        l.AddNew
            l(0) = t(1)
            TipodePrecio = CualTipoPrecio(List1.list(i))
            For i = 0 To List2.ListCount - 1
                If i < 5 Then
                    p = cual_precio(t(0), TipodePrecio)
                    l(i + 1) = p
                End If
            Next
            l("cod_examen") = t(0)
        l.Update
        t.MoveNext
    Wend
'    On Error Resume Next
    'Set 'FrmReporte.Report = New RepLista
    'FrmReporte.Show vbModal
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select IDE from IDEN")
    While Not t.EOF
        List1.AddItem t(0)
        t.MoveNext
    Wend
    Me.Caption = titulo2("Lista de precios por Iden")
    
End Sub

Private Sub Label1_Click()

End Sub

